import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:sp_util/sp_util.dart';

class StorageManager {
  /// app全局配置 eg:theme
  // static SharedPreferences sharedPreferences;

  /// 临时目录 eg: cookie
  static Directory temporaryDirectory;

  /// app全局配置
  static SharedPreferences sp;

  static final navKey = new GlobalKey<NavigatorState>();

  static BuildContext context = navKey.currentState.overlay.context;

  /// 必备数据的初始化操作
  ///
  /// 由于是同步操作会导致阻塞,所以应尽量减少存储容量
  static init() async {
    // async 异步操作
    // sync 同步操作

    await SpUtil.getInstance();
  }
}
